<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Modern UI CSS">
    <meta name="author" content="Sergey Pimenov">
    <meta name="keywords" content="windows 8, modern style, modern ui, style, modern, css, framework">

    <link href="css/modern.css" rel="stylesheet">
    <link href="css/site.css" rel="stylesheet" type="text/css">
    <link href="js/google-code-prettify/prettify.css" rel="stylesheet" type="text/css">

    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/google-analytics.js"></script>
    <script src="js/github.info.js"></script>
    <script src="js/google-code-prettify/prettify.js"></script>
    <script src="js/pagecontrol.js"></script>

    <title>View Boarding Pass</title>
</head>
<body class="modern-ui" onload="prettyPrint()">

<%
	String username = request.getParameter("username");
%>
    <div class="page secondary">

        <div class="page-header">
            <div class="page-header-content">
                <h1>Boarding Pass ${username}</h1>
                <a href = "/Website/BackButtonURL?username=<%=username %>" class="back-button big page-back"></a>
            </div>
        </div>
		<br>
		<br>
        <div class="page-region">
            <div class="page-region-content">
					
			<form action = "/Website/DisplayPassURL" method = "get">
			<table class="hovered" style="width: 750px;">
            <thead>
            	<c:choose>
               		<c:when test="${isEmpty=='false'}">
						<tr>
							<th class="left">ID</th>
							<th class="left">Airline</th>		
							<th class="left">Name</th>
							<th class="left">Leaving</th>
							<th class="left">Arriving</th>	
							<th class="left">Seat</th>
							<th class="left">Gate</th></tr>
						<tbody>	
							<c:forEach items="${passList}" var="passInfo">
								<tr>	
									<td>
										<label class="radio" onclick="">
		                     				<input type="radio" name="r1" value = "${passInfo.ID}"/>
		                 				</label>
		                 				<c:out value="${passInfo.ID}" />
									</td>
									<td><img src = "<c:out value="${passInfo.image}" />"/></td>	
									<td><c:out value="${passInfo.fullName}" /></td>	
									<td>
										<c:out value="${passInfo.leavingLocation}" />
										<br>
										<c:out value="${passInfo.leavingDate}" />
										<br>
										<c:out value="${passInfo.leavingTime}" />
									</td>
									
									<td>
										<c:out value="${passInfo.arrivingLocation}" />
										<br>							
										<c:out value="${passInfo.arrivingDate}" />
										<br>
										<c:out value="${passInfo.arrivingTime}" />
									</td>																	
									<td><c:out value="${passInfo.seat}" /></td>	
									<td><c:out value="${passInfo.gate}" /></td>	
								</tr>
							</c:forEach>					
						</tbody>	
					</c:when>
					<c:when test="${isEmpty=='true'}">
						<tr>
							<th class=Left>No Data To Display. No Reservations are made.</th>
						</tr>
					</c:when>		
				</c:choose>	
			</thead>
            </table>
            
           <input type = "hidden" name = "username" value = <%=username %>>
									
		   <br>
		   <c:if test="${isEmpty=='false'}">
		 	  <input type="submit" value="View Pass" style="margin-left: 650px"/>
			</c:if>
		   </form>		


            </div>
        </div>

    </div>

</body>
</html>